# 继承的示例
# Human 类派生出 Student 类

class Human:  # 定义一个人类
    def say(self, what):
        '说'
        print("说:", what)

    def walk(self, distance):
        '走路'
        print('走了', distance, 'km')

class Student(Human):
    def study(self, subject):
        print('正在学习', subject)

class Teacher(Human):
    def teach(self, subject):
        print('老师在教', subject)

t1 = Teacher()
t1.say('明天我也放假')
t1.walk(6)
t1.teach('Python')

s1 = Student()
s1.say('明天放假')
s1.walk(9)
s1.study('面向对象')

h1 = Human()
h1.say('天气真好')
h1.walk(5)